﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vds2465Telegrams
{
	public class ReportType_Base
	{
		#region private member variables

		private bool _onOffFlag;

		#endregion private member variables

		#region constructor

		protected ReportType_Base(bool onOffFlag)
		{
			_onOffFlag = onOffFlag;
		}

		#endregion constructor

		#region getters

		public bool OnOffFlag { get { return _onOffFlag; } }

		#endregion getters

		#region ToString, Equals, GetHashCode

		public override int GetHashCode()
		{
			int hashCode = OnOffFlag ? 1 : 0;
			
			return hashCode;
		}
		
		internal virtual string ToStringProperties()
		{
			StringBuilder stringBuilder = new StringBuilder();

			stringBuilder.Append("OnOffFlag='");
			stringBuilder.Append(OnOffFlag);
			stringBuilder.Append("'");		

			return stringBuilder.ToString();
		}

		public override bool Equals(object obj)
		{
			Type objType = obj.GetType();
			if (this.GetType() == objType)
			{
				ReportType_Base reportTypeBase2Compare = obj as ReportType_Base;
				return EqualsProperties(reportTypeBase2Compare);
			}

			return false;
		}

		internal bool EqualsProperties(ReportType_Base reportTypeBase2Compare)
		{
			return (OnOffFlag == reportTypeBase2Compare.OnOffFlag);
		}

		#endregion ToString, Equals, GetHashCode
	}
}
